package com.electromagnetic.industry.software.manage.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.electromagnetic.industry.software.manage.pojo.other.TreeNode;
import com.electromagnetic.industry.software.manage.pojo.models.EdTagLibrary;
import com.electromagnetic.industry.software.manage.pojo.resp.FileTagInfo;
import com.electromagnetic.industry.software.manage.pojo.resp.TagListVO;

import java.util.List;

public interface EdTagLibraryService extends IService<EdTagLibrary> {

    /**
     * 新建分组
     *
     * @param tagName
     * @param createdBy
     */
    Boolean createTagGroup(String tagName, String createdBy);

    /**
     * 新建标签
     *
     * @param parentId
     * @param tagName
     * @param createdBy
     */
    Boolean createTag(String parentId, String tagName, String createdBy);

    /**
     * 拖拽标签顺序
     *
     * @param tagId
     * @param newOrderBy
     */
    Boolean updateTagOrder(String tagId, String newTagId, String newParentId, Integer newOrderBy, String updatedBy);

    /**
     * 发布标签
     *
     * @param tagGroupIds
     */
    Boolean batchPublishTagGroups(List<String> tagGroupIds);

    /**
     * 废除标签
     *
     * @param tagId
     * @return
     */
    Boolean deleteTagOrGroup(String tagId);

    /**
     * 标签数据
     *
     * @return
     */
    List<TagListVO> listTagsWithGroups();

    /**
     * 更新标签信息
     *
     * @param tagId
     * @param tagName
     * @return 更新结果
     */
    Boolean updateTagInfo(String tagId, String tagName, String updatedBy);

    /**
     * 构建标签树
     *
     * @return
     */
    List<TreeNode> listTagTree();

    /**
     * 获取所有标签
     *
     * @return
     */
    List<FileTagInfo> listAllTags();
}
